package zezutom.designpatterns.cor;

/**
 *
 * @author tomasz
 */
public class App {

    public static final String REJECTED = "Oops, too high. Rejected.";
    
    public static void main(String[] args) {
        // customers
        LoanRequest[] requests = {
            new LoanRequest("Jimmy", 800),
            new LoanRequest("Ben", 5000),
            new LoanRequest("Alan", 90000),
            new LoanRequest("Harry", 200000)
        };
        
        for (LoanRequest request : requests) {
            if (!RequestHandlerGateway.getInstance().handleRequest(request)) {
                System.out.println(REJECTED);
            }
        }
    }
}
